package com.market2.utils.converter.impl;

import com.market2.dto.NegociationPrixFixDto;
import com.market2.model.NegociationPrixFix;
import com.market2.utils.converter.Converter;

public class NegociationPrixFixConverter extends Converter
{
	@SuppressWarnings("unchecked") @Override
	public NegociationPrixFixDto convertTo(Object source)
	{
		if(source == null || !(source instanceof NegociationPrixFix)) {
			return null;
		}
		
		System.out.println("NegociationPrixFixConverter.convertTo");
		
		NegociationPrixFix nego = (NegociationPrixFix) source;
		NegociationPrixFixDto dto = new NegociationPrixFixDto();
		
		dto.setNumero(nego.getNumero());
		dto.setPrix(nego.getPrix());
		
		return dto;
	}

	@SuppressWarnings("unchecked") @Override
	public NegociationPrixFix convertFrom(Object source)
	{
		if(source == null || !(source instanceof NegociationPrixFixDto)) {
			return null;
		}
		
		System.out.println("NegociationPrixFixConverter.convertFrom");
		
		NegociationPrixFixDto dto = (NegociationPrixFixDto) source;
		NegociationPrixFix nego = new NegociationPrixFix();
		
		nego.setNumero(dto.getNumero());
		nego.setPrix(dto.getPrix());
		
		return nego;
	}
}
